package com.nefu.editor.core.mapper;

import com.nefu.editor.core.mapper.provider.ArticleProvider;
import com.nefu.editor.core.model.Article;
import com.nefu.editor.core.model.Vo.ArticleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author chenchenT
 * @date : 18-11-13
 * @since : java 8
 */
@Mapper
@Repository
public interface ArticleMapper {

    /**
     * 获取文章
     *
     * @param article
     * @return Article
     */
    @SelectProvider(type = ArticleProvider.class, method = "selectArticleByCondition")
    List<Article> selectArticleByCondition(Article article);

    /**
     * 获取最新文章列表
     * @param articleVo
     * @return List<Article>
     */
    @SelectProvider(type = ArticleProvider.class, method = "selectLatestArticle")
    List<Article> selectLatestArticle(ArticleVo articleVo);

}
